﻿<%@ Page Title="" Language="C#" MasterPageFile="~/user/MasterPage2.master" AutoEventWireup="true" CodeFile="QueryOrder.aspx.cs" Inherits="user_QueryOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style5 {
            margin-left: 118px;
            margin-top: 0px;
        }
        .auto-style6 {
            text-align: center;
        }
        .auto-style8 {
            width: 100%;
        }
        .auto-style9 {
            height: 24px;
        }
        .auto-style10 {
            text-align: right;
            margin-left: 0px;
            margin-top: 0px;
        }
        .auto-style11 {
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="auto-style8">
        <tr>
            <td class="auto-style11">
                    <asp:Label ID="Label2" runat="server" Text="请输入商品名称"></asp:Label>
                    &nbsp;<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    &nbsp;
                    &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="查询" />
                    &nbsp;&nbsp;<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="返回" />
                    &nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td class="auto-style11">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style9" colspan="2">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" CssClass="auto-style10" DataKeyNames="订单编号" DataSourceID="SqlDataSource1" GridLines="None" Height="16px" ShowHeaderWhenEmpty="True" Width="1041px" ForeColor="#333333">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="订单编号" HeaderText="订单编号" SortExpression="订单编号" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="客户编号" HeaderText="客户编号" SortExpression="客户编号" ReadOnly="True" />
                <asp:BoundField DataField="商品名称" HeaderText="商品名称" SortExpression="商品名称" ReadOnly="True" />
                <asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" ReadOnly="True" />
                <asp:BoundField DataField="总价" HeaderText="总价" SortExpression="总价" ReadOnly="True" />
                <asp:BoundField DataField="创建时间" HeaderText="创建时间" SortExpression="创建时间" ReadOnly="True" />
                <asp:CheckBoxField DataField="订单状态" HeaderText="订单状态" SortExpression="订单状态" ReadOnly="True" />
                <asp:CheckBoxField DataField="收货状态" HeaderText="收货状态" SortExpression="收货状态" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
            </td>
        </tr>
    </table>
    &nbsp;<br />
    <div class="auto-style6">
    </div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:keshe2ConnectionString %>" SelectCommand="SELECT 订单.订单编号, 订单.客户编号, 商品.商品名称, 订单.数量, 订单.总价, 订单.创建时间, 订单.订单状态,收货状态 FROM 订单 INNER JOIN 商品 ON 订单.商品编号 = 商品.商品编号 WHERE (订单.客户编号 = @客户编号)" UpdateCommand="UPDATE 订单 SET 收货状态 = @收货状态 WHERE [订单编号] = @订单编号 and [收货状态]=0
">
        <SelectParameters>
            <asp:SessionParameter Name="客户编号" SessionField="id" Type="Int64" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="收货状态" />
            <asp:Parameter Name="订单编号" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

